package com.baizhi.service.impl;

import com.baizhi.annolation.LogAnnotation;
import com.baizhi.dao.UserDTODao;
import com.baizhi.entity.UserDTO;
import com.baizhi.service.UserDTOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@Transactional
public class UserDTOServiceImpl implements UserDTOService {
    @Autowired
    private UserDTODao userDTODao;

    @Override
    @LogAnnotation(type = "数据信息查询",value="查看了用户男女性别比例")
    public  List<Map> selectSexCount() {
        List<Map> userDTOS = userDTODao.selectSexCount();
        return userDTOS;
    }

    @Override
    @LogAnnotation(type = "数据信息查询",value="查看了用户地区分布信息")

    public List<Map> selectProvinceCount() {

        List<Map> maps = userDTODao.selectProvinceCount();

        return maps;
    }

    @Override
    @LogAnnotation(type = "数据信息查询",value="查看了用户近三周的注册数量")

    public int[] selectDateCount() {
        int a = userDTODao.selectDateCount(1);
        int b = userDTODao.selectDateCount(2);
        int c = userDTODao.selectDateCount(3);

        int[] ids={a,b,c};
        return ids;
    }


}
